package com.bwie.controller.api;

import com.bwie.api.common.SimpleRandomLottery;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/api")
public class TestController {


    @Autowired
    private SimpleRandomLottery simpleRandomLottery;


    @PostMapping("/hello/{userName}")
    public String hello(@PathVariable(name = "userName") String userName){
        String userName1 = simpleRandomLottery.draw(userName);
        log.info("draw:{}",userName1);
        return userName1;
    }
}
